<?php

/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */
return array(
    'controllers' => array(
        'invokables' => array(
            'Componentes\Controller\Restfull' => 'Componentes\Controller\RestfulController',
            'Componentes\Controller\UtilsArray' => 'Componentes\Controller\UtilsArrayController'
        ),
    ),
    'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route' => '/',
                    'defaults' => array(
                        'controller' => 'Componentes\Controller\Restfull',
                        'action' => 'index',
                    ),
                ),
            ),
            'componentes' => array(
                'type' => 'Literal',
                'options' => array(
                    'route' => '/componentes',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Componentes\Controller',
                        'controller' => 'Restful',
                    //ojo creo que no va pero sin eso se va a un metodo de 
                    //getlist que no exite en el controlador index
                    //'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'default' => array(
                        'type' => 'Segment',
                        'options' => array(
                            'route' => '/:controller[/:id][/:param1][/:param2]',
                            //'route'    => '/[:controller[/:action[/:id]]]',
                            //'route'    => '/[:controller[/:action[/:id/:id2]]]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'id' => '[0-9a-zA-Z]+',
                            ),
                            'defaults' => array(
                            ),
                        ),
                    ),
                ),
            ),
        ),
    ),
    //listo
    'service_manager' => array(
        'factories' => array(
            'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
        ),
    ),
    //listo
    'translator' => array(
        'locale' => 'en_US',
        'translation_file_patterns' => array(
            array(
                'type' => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern' => '%s.mo',
            ),
        ),
    ),
    'view_manager' => array(//Add this config
        'strategies' => array(
            'ViewJsonStrategy',
        ),
    ),
);
